package com.lyf.service.admin.impl;

import com.lyf.mapper.admin.WorkSpaceMapper;
import com.lyf.service.admin.WorkSpaceService;
import com.lyf.vo.BusinessDataVO;
import com.lyf.vo.DishOverViewVO;
import com.lyf.vo.OrderOverViewVO;
import com.lyf.vo.SetmealOverViewVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class WorkSpaceServiceImpl implements WorkSpaceService {
    @Autowired
    private WorkSpaceMapper workSpaceMapper;

    /**
     * 获取今日营业数据
     * @return
     */
    @Override
    public BusinessDataVO getBusinessData() {
        LocalDate now = LocalDate.now();
        BusinessDataVO businessDataVO = workSpaceMapper.getBusinessData(now,null,null);
        return businessDataVO;
    }

    /**
     * 菜品总览
     * @return
     */
    @Override
    public DishOverViewVO overviewDishes() {
        DishOverViewVO dishOverViewVO = workSpaceMapper.overviewDishes();
        return dishOverViewVO;
    }

    /**
     * 套餐总览
     * @return
     */
    @Override
    public SetmealOverViewVO overviewSetmeals() {
        SetmealOverViewVO setmealOverViewVO = workSpaceMapper.overviewSetmeals();
        return setmealOverViewVO;
    }
    /**
     * 订单总览
     * @return
     */
    @Override
    public OrderOverViewVO overviewOrders() {
        OrderOverViewVO orderOverViewVO = workSpaceMapper.overviewOrders();
        return orderOverViewVO;
    }
}
